#include <iostream>
#include <string>
#include <jsoncpp/json/json.h>
#include <memory>

int main()
{
    Json::Value root;
    root["name"] = "张三";
    root["sex"] = "男";
    root["age"] = 18;

    // Json::StreamWriterBuilder sbuilder;
    // std::unique_ptr<Json::StreamWriter> writer(sbuilder.newStreamWriter());
    // std::stringstream ss;
    // writer->write(root, &ss);
    // std::string s = ss.str();
    // std::cout << s << std::endl;

    Json::FastWriter writer;
    //Json::StyledWriter writer;

    std::string s = writer.write(root);

    //std::string s = root.toStyledString();
    //std::cout << s << std::endl;
    return 0;
}